Image reproduction apparatus, control method thereof, program and storage medium

ABSTRACT

An object of this invention is to suppress discontinuity of a moving image as much as possible. In order to achieve this object, an image reproduction apparatus includes a buffer which temporarily stores an encoded image data stream, a buffer size setting circuit which sets the storage size of the buffer, a decoding time calculation circuit which calculates a decoding time at which the encoded image data stream is output from the buffer to a decoder, and a control circuit which controls to set the storage size of the buffer to at least twice the maximum value of a storage size required by an encoded data stream reproducible by the image reproduction apparatus, start fetching a second encoded image data stream in the buffer immediately after fetch of a first encoded image data stream in the buffer is ended, and calculate the decoding time of the second image data stream on the basis of a time when fetch of the first image data stream in the buffer is ended.

FIELD OF THE INVENTION

The present invention relates to a technique of reproducing an imageand, more particularly, to a technique of reproducing moving image datausing inter-frame encoding.

BACKGROUND OF THE INVENTION

In recent years, digital video cameras and. digital cameras which encodemoving image data by using inter-frame encoding such as MPEG andrecord/reproduce the data are widely used.

In encoding image data by using MPEG, it is done in accordance with avirtual buffer model called vbv_buffer in order to guarantee thatencoded image data will be decoded by a decoder without any loss. Thedecoder decodes image data input from a recording medium or transmissionline in accordance with the vbv_buffer model.

An operation of reproducing, from a recording medium, image data encodedby MPEG and decoding it will be described with reference to FIGS. 5A to5C and 6.

FIG. 6 is a block diagram showing an example of a reproductionapparatus. When a reproduction instruction is input, a control circuit507 shown in FIG. 6 instructs a reproduction circuit 502 to reproduce,reads out a stream A of MPEG data recorded on a recording medium 501,and writes reproduced data in a buffer 503. As shown in FIG. 5A, thecontrol circuit 507 reads out the stream A from the recording medium 501at time t_(a) and writes it in the buffer 503. The control circuit 507notifies a decoding time calculation circuit 506 of the fetch time t_(a)in the buffer 503.

At time t₀ shown in FIG. 5A, the control circuit 507 reads out firstimage data V₀ from the buffer 503 and sends the data to a decoder (notshown).

On the basis of vbv_delayA(0) detected by a vbv_delay detection circuit504, the decoding time calculation circuit 506 calculates the time t₀given byt ₀ =t _(a) +vbv_delayA(0)   (1)The vbv_delay data is information representing a time during which eachpicture data of an MPEG stream stays in the buffer memory when thepicture data is to be decoded.

The decoding time t₀ calculated by the decoding time calculation circuit506 is supplied to the control circuit 507. At the time t₀, the controlcircuit 507 reads out the reproduced data V₀ of the stream A from thebuffer 503 and outputs the data from an output terminal 508 to a decoder(not shown).

Decoding time t_(q) from the time t₀ is calculated by the decoding timecalculation circuit 506 byt _(q) =t ₀ +T _(v) ×q(q=0, 1, 2, . . . )   (2)and supplied to the control circuit 507, where T_(v) is the reciprocalof the frame frequency (e.g., 29.97 Hz) of the image data.

When the time t₀ has come, the control circuit 507 notifies the decodingtime calculation circuit 506 of it. The decoding time calculationcircuit 506 supplies next decoding time t₁ to the control circuit 507.

At the time t₁, the control circuit 507 reads out V₁ of the stream A ofthe reproduced data fetched in the buffer 503, outputs the data to theoutput terminal 508, and sends it to the decoder (not shown).

In the above-described way, the image data is reproduced until times t₂,t₃, . . . , t_(n) so that reproduction of the stream A is ended.

The encoder must encode image data without causing overflow or underflowof the above-described vbv_buffer model. The decoder can decode imagedata without any failure such as frame skip or frame hold by executingreproduction in accordance with the vbv_buffer model.

Consider a case wherein another stream B is reproduced next to thestream A recorded on the recording medium.

To reproduce without causing overflow or underflow of the vbv_buffermodel on the decoder side, the control circuit 507 controls thereproduction circuit 502 and buffer 503 such that after the finalreproduced data of the stream A is read out from the buffer 503 atdecoding time t_(n) the data of the stream B is fetched in the buffer503, as shown in FIG. 5B.

The control circuit 507 notifies the decoding time calculation circuit506 of the fetch time t_(n) of the stream B and fetches the stream B inthe buffer 503 through the reproduction circuit 502.

The vbv_delay detection circuit 504 detects vbv_delayB(0) and suppliesit to the decoding time calculation circuit 506. On the basis of thefetch time t_(n) and vbv_delayB(0), the decoding time calculationcircuit 506 calculates a decoding time t_(m) given byt _(m) =t _(n) +vbv_delayB(0)   (3)(t_(n+3)=t_(m) FIG. 5B) and supplies the decoding time t_(m) to thecontrol circuit 507.

The decoding time of the stream B is calculated by the decoding timecalculation circuit 506 byt _(r) =t _(n) +T _(v) ×r(r=0, 1, 2, . . . )   (4)The control circuit 507 controls the fetch/read in/from the buffer inthe same way as for the stream A, as shown in FIG. 5B.

In the above-described method, neither buffer overflow nor underflowoccurs because the stream B is fetched in the buffer 503 after thestream A is completely read out from the buffer 503 at the decoding timeof the last data of the stream A. However, since decoding cannot beexecuted at the reproduction transition from the stream A to the streamB, i.e., at times t_(n+1) and t_(n+2), the reproduced image of thestream A cannot smoothly be switched to that of the stream B. That is,the continuity of a reproduced image is disrupted.

To solve this problem, Japanese Patent Laid-Open No. 2002-158968proposes a technique in which fetch of the stream B in the buffer 503 isstarted from an end time t_(e) of fetch of the stream A in the buffer503, as shown in FIG. 5C, to speed up fetch in the buffer 503 whilestopping fetch in the buffer 503 if overflow is going to occur. Thedecoding time of the stream B is set at t_(s) in FIG. 5C to shorten thetime of discontinuity of a reproduced image (the time while thecontinuity of decoding times is damaged) as much as possible.

Although this method can solve the problem of interruption of thediscontinuity of a reproduced image, there is still room forimprovement.

SUMMARY OF THE INVENTION

The present invention has been in consideration of the above-describedproblems, and has as its object to suppress discontinuity of a movingimage as much as possible in continuous reproduction of the movingimage.

In order to solve the above-described problem and achieve the object,according to the first aspect of the present invention, there isprovided an image reproduction apparatus comprising: a reproducingdevice which reproduces an image data stream encoded by usinginter-frame encoding; a buffer device which temporarily stores theencoded image data stream reproduced by the reproducing device; a buffersize setting device which sets an amount of image data which can bestored in the buffer device; a decoding time calculation device whichcalculates a decoding time as a timing at which the encoded image datastream is output from the buffer device to a decoder; and a controldevice which controls the buffer device, the buffer size setting device,and the decoding time calculation device to set the amount of image datawhich can be stored in the buffer device to at least twice a maximumvalue of an amount required by an encoded data stream reproducible bythe image reproduction apparatus, start storing a second encoded imagedata stream in the buffer device after storage of a first encoded imagedata stream in the buffer device is ended before the first image datastream is completely output to the decoder, and calculate a decodingtime of the second image data stream on the basis of a time when storageof the first image data stream in the buffer device is ended. Accordingthe second aspect of the present invention, there is provided an imagereproduction apparatus comprising: a reproducing device which reproducesan image data stream encoded by using inter-frame encoding; a bufferdevice which temporarily stores the encoded image data stream reproducedby the reproduction device; a buffer size setting device which sets anamount of image data which can be stored in the buffer device; adecoding time calculation device which calculates a decoding time as atiming at which the encoded image data stream is output from the bufferdevice to a decoder; and a control device which controls the bufferdevice, the buffer size setting device, and the decoding timecalculation device to set a storage size required by a first encodedimage data stream as the storage size of the buffer device, startfetching a second encoded image data stream in the buffer deviceimmediately after fetch of the first image data stream in the bufferdevice is ended, set again a sum of a value of a storage size requiredby the second image data stream and a value of the storage size requiredby the preceding first image data stream as the storage size of thebuffer device, and calculate a decoding time of the second image datastream on the basis of a time when fetch of the first image data streamin the buffer device is ended. According to the third aspect of thepresent invention, there is provided a method of controlling an imagereproduction apparatus including a reproducing device which reproducesan image data stream encoded by using inter-frame encoding, a bufferdevice which temporarily stores an encoded image data stream reproducedby the reproducing device, a buffer size setting device which sets anamount of image data which can be stored in the buffer device, and adecoding time calculation device which calculates a decoding time as atiming at which the encoded image data stream is output from the bufferdevice to a decoder, comprising: a buffer size setting step of causingthe buffer size setting device to set the storage size of the bufferdevice to at least twice a maximum value of a storage size required byan encoded data stream reproducible by the image reproduction apparatus;a data fetch step of starting fetching a second encoded image datastream in the buffer device immediately after fetch of a first encodedimage data stream in the buffer device is ended; and a decoding timecalculation step of causing the decoding time calculation device tocalculate a decoding time of the second image data stream on the basisof a time when fetch of the first image data stream in the buffer deviceis ended. According to the fourth aspect of the present invention, thereis provided a method of controlling an image reproduction apparatusincluding a reproducing device which reproduces an image data streamencoded by using inter-frame encoding, a buffer device which temporarilystores an encoded image data stream reproduced by the reproductiondevice, a buffer size setting device which sets an amount of image datawhich can be stored in the buffer device, and a decoding timecalculation device which calculates a decoding time as a timing at whichthe encoded image data stream is output from the buffer device to adecoder, comprising: a buffer size setting step of causing the buffersize setting device to set a storage size required by a first encodedimage data stream as the storage size of the buffer device; a data fetchstep of starting fetching a second encoded image data stream in thebuffer device immediately after fetch of the first image data stream inthe buffer device is ended; a buffer size re-setting step of settingagain a sum of a value of a storage size required by the second imagedata stream and a value of the storage size required by the precedingfirst image data stream as the storage size of the buffer device; and adecoding time calculation step of causing the decoding time calculationdevice to calculate a decoding time of the second image data stream onthe basis of a time when fetch of the first image data stream in thebuffer device is ended. According to the fifth aspect of the presentinvention, there is provided a program characterized by causing acomputer to execute the above control method.

According to the sixth aspect of the present invention, there isprovided a computer-readable storage medium characterized by storing theabove program.

Other objects and advantages besides those discussed above shall beapparent to those skilled in the art from the description of a preferredembodiment of the invention which follows. In the description, referenceis made to accompanying drawings, which form a part hereof, and whichillustrate an example of the invention. Such example, however, is notexhaustive of the various embodiments of the invention, and thereforereference is made to the claims which follow the description fordetermining the scope of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing the arrangement of an imagereproduction apparatus according to the first embodiment of the presentinvention;

FIG. 2 is a block diagram showing the arrangement of an imagereproduction apparatus according to the second embodiment of the presentinvention;

FIG. 3 is a block diagram showing the arrangement of an imagereproduction apparatus according to the third embodiment of the presentinvention;

FIG. 4 is a timing chart for explaining a moving image data buffer modelin the image reproduction apparatus of the present invention;

FIGS. 5A to 5C are timing charts for explaining conventional movingimage data buffer models; and

FIG. 6 is a block diagram for explaining a conventional moving imagedata recording format.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Preferred embodiments of the present invention will be described belowin detail with reference to the accompanying drawings.

First Embodiment

FIG. 1 is a block diagram showing the arrangement of an imagereproduction apparatus according to the first embodiment of the presentinvention.

Referring to FIG. 1, reference numeral 101 denotes a recording medium;102, a reproduction circuit; 103, a buffer memory; 104, a decoder; 104a, a decoded data output terminal; 105, a buffer occupation amountdetection circuit; 106, a buffer size detection circuit; 107, avbv_delay detection circuit which detects vbv_delay data added to eachpicture data from reproduced stream data; 108, a buffer fetch startdetection circuit; 109, a buffer fetch end detection circuit; 110, adecoding time calculation circuit; 111, a buffer size determinationcircuit; and 112, a control circuit.

When the reproduction mode starts, the buffer size determination circuit111 sends, to the control circuit 112, a maximum value VF_(max) of thebuffer size processible by the image reproduction apparatus of thisembodiment. The control circuit 112 calculates a value twice the maximumvalue VF_(max) of the buffer size input from the buffer sizedetermination circuit 111 byVS=VF _(max)×2   (5)to set a size (storable data amount) VS of the buffer memory 103.

Upon receiving a reproduction instruction, the control circuit 112controls the reproduction circuit 102 to reproduce a designated stream Afrom the recording medium 101. The reproduction circuit 102 reads outthe data of the stream A from the recording medium 101 and writes thedata in the buffer memory 103. FIG. 4 shows simulation of reproduceddata stored in the buffer memory 103.

The control circuit 112 reads out the stream A from the recording mediumthrough the reproduction circuit 102 and writes the readout data in thebuffer memory 103 until time t₀ shown in FIG. 4. At the time t₀, data V₀of the stream A stored in the buffer memory 103 is read out, andsupplied to a decoder 104 Output data from the decoder 104 are output tothe output terminal 104 a.

The time t₀ is calculated by the decoding time calculation circuit 110in the following way.

The vbv_delay detection circuit 107 in FIG. 1 detects vbv_delayA(0) ofthe first frame of the stream A and supplies vbv_delayA(0) to thedecoding time calculation circuit 110. The buffer fetch start detectioncircuit 108 detects start time t_(a) of fetch of the stream A in thebuffer memory 103 and supplies the fetch start time t_(a) to thedecoding time calculation circuit 110. On the basis of the time t_(a)and vbv_delayA(0), the decoding time calculation circuit 110 calculatesthe time t₀ given byt ₀ =t _(a) +vbv_delayA(0)   (1)and supplies the decoding start time t₀ of the first frame other controlcircuit 112. At the time t₀, the control circuit 112 reads out the dataV₀ of the first frame of the stream A from the buffer memory 103,supplies the data V₀ to the decoder 104.

Decoding time t_(q) from the time t₀ shown in FIG. 4 is calculated bythe decoding time calculation circuit 506 byt _(q) =t ₀ +T _(v) ×q(q=0, 1, 2, . . . )   (2)and supplied to the control circuit 507, where T_(v) is the reciprocalof the frame frequency (e.g., 29.97 Hz) of the image data.

The control circuit 112 controls the reproduction circuit 102 tocontinuously reproduce the stream A from the recording medium 101 andwrite it in the buffer memory 103 even after the time t₀. On the basisof the decoding time supplied from the decoding time calculation circuit110, reproduced data V₁, V₂, . . . are read out from the buffer memory103 at times t₁, t₂, . . . , and supplied to the decoder 104.

As shown in FIG. 4, the read of the stream A from the recording medium101 is ended at time t_(e). In this embodiment, at this point of time,the control circuit 112 controls the reproduction circuit 102 to readout next stream B from the recording medium 101 and write it in thebuffer memory 103 (a solid line after the time t_(e) in FIG. 4).

The buffer size detection circuit 106 detects vbv_buffer_size(=v_size(B)) data in the sequence header at the start of the stream Band checks whether the sum of the vbv_buffer_size (=v_size(B)) data andvbv_buffer_size (=V_size(A)) data of the stream A exceeds the set sizeVS of the buffer memory 103.

The vbv_buffer_size data is described in the sequence header of anelementary stream in an MPEG stream. A sequence header is headerinformation inserted in the sequence layer of an elementary stream inMPEG data. The vbv_buffer_size data is added to, e.g., each data of oneGOP and indicates the maximum occupation data amount of the buffermemory in decoding the data of the sequence layer. Hence, at the time ofdecoding, data stored in the buffer memory never exceedsvbv_buffer_size.

The buffer occupation amount detection circuit 105 detects theoccupation amount of reproduced data in the buffer memory 103 andnotifies the control circuit 112 of the occupation amount. The controlcircuit 112 monitors whether the buffer occupation amount supplied fromthe buffer occupation amount detection circuit 105 exceeds the buffersize VS set for the buffer memory 103. If the occupation amount is goingto exceed the buffer size VS, reproduction from the recording medium isstopped to interrupt data fetch in the buffer memory 103.

It is checked from this point of time whether the sum of v_size(B) andthe data amount of the stream A stored in the buffer memory 103 exceedsthe set size VS. When the sum becomes smaller than the set size VS, theread of the data of the stream B from the recording medium is started.

As shown in FIG. 4, the control circuit 112 reads out reproduced dataV_(n−2) and V_(n−1) of the stream A at times t_(n−2) and t_(n−1),respectively. Finally, reproduced data V_(n) of the stream A is read outfrom the buffer memory 103 at time t_(n), and reproduction of the streamA to the decoder 104 is ended.

The vbv_delay detection circuit 107 detects the vbv_delay value(=vbv_delayB(0)) on the basis of vbv_delay data of the first frame ofthe stream B and supplies the vbv_delay value to the decoding timecalculation circuit 110. The buffer fetch end detection circuit 109detects the end time t_(e) (time t_(e) in FIG. 4) of the read of thestream A from the recording medium 101 and supplies the time t_(e) tothe decoding time calculation circuit 110.

The decoding time calculation circuit 110 calculatest _(y) =t _(e) +vbv_delayB(0)   (6)and supplies the time t_(y) to the control circuit 112.

If the time t_(y) satisfies(t _(y) −t ₀) mod (T _(v))≠0   (7)(A mod B indicates the remainder obtained by dividing A by B), thecontrol circuit 112 stops reading the stream B from the recording medium101 to interrupt the write in the buffer memory 103 at the time t_(y)(the time from the time t_(y) to time t_(n+1) in FIG. 4). At the timet_(n+1), the read of the data of the stream B from the recording mediumis started again. Ift_(y)≦t_(n+1)   (8)the decoding time calculation circuit 110 calculates a decoding starttime t_(k) of the stream B byt_(k)=t_(n+1)   (9)

The time t_(n+1) and the read time t_(n) of the last data V_(n) of thestream A from the buffer memory 103 have a relationship given byt _(n+1) =t _(n) +T _(v)   (10)

Decoding time t_(n) after the time t_(k) of the stream B (timet_(n+1)(=t_(n)+T_(v))) is given byt _(u) =t _(k) +T _(v) ×u(u=0, 1, 2, . . . )   (11)Whent_(y)>t_(n+1)   (12)and expression (7) holds, we have

$\begin{matrix}{t_{k} = {t_{0} + \left\lbrack {t_{y} - t_{0} - \left( {\left( {t_{y} - t_{0}} \right)\mspace{11mu}{mod}\mspace{11mu}\left( T_{v} \right)} \right)} \right\rbrack + T_{v}}} & (12)\end{matrix}$When(t _(y) −t ₀) mod (T _(v))=0   (13)we havet _(k) =t ₀ +[t _(y) −t ₀ ]=t _(y)   (14)

Hence, the decoding time t_(u) of the stream B after the time t_(k) isgiven byt _(u) =t _(k) +T _(v) ×u(u=0, 1, 2, . . . )   (11)

The decoding time calculation circuit 110 calculates the decoding timet_(u) of the stream B in the above-described way and supplies the timet_(u) to the control circuit 112. The control circuit 112 reads out thereproduced data of the stream B from the buffer memory 103 in accordancewith the decoding time from the decoding time calculation circuit 110and supplies the reproduced data to the decoder 104. In other words, thecontrol circuit 112 controls the buffer memory 103 to read outreproduced data from the buffer memory 103 in accordance with thedecoding time (times t_(n+1)(t_(k)), t_(n+1)(t_(k)+T_(v)×u), . . . ,t_(u), . . . in FIG. 4), outputs the reproduced data to the decoder 104.

As described above, in this embodiment, a size at least twice the buffermemory occupation data amount vbv_buffer_size of MPEG data processibleby the reproduction apparatus is set as the size of the buffer memory inthe reproduction mode. When the stream B is to be reproduced from therecording medium next to the stream A, the time t_(e) at which the lastdata of the reproduced data of the preceding stream A is read out fromthe recording medium is detected. From the read end time t_(e), fetch ofthe reproduced data of the next stream B in the buffer memory isstarted.

That is, the apparatus is designed such that even when data stored inthe buffer memory 103 exceeds vbv_buffer_size, the data of the stream Bcan be stored in the buffer memory 103. In addition, the decoding starttime of the first frame of the stream B is calculated from the read endtime t_(e) of the data of the final frame of the stream A. Discontinuitywhich occurs when the reproduced image of the stream A is switched tothat of the stream B can be minimized. Hence, discontinuity of a movingimage can also be minimized (in this embodiment, when t_(y)≦t_(n+1), thecontinuity of decoding times is maintained, as shown in FIG. 4, and amoving image is smoothly reproduced).

Second Embodiment

FIG. 2 is a block diagram showing the arrangement of an imagereproduction apparatus according to the second embodiment of the presentinvention.

Referring to FIG. 2, reference numeral 101 denotes a recording medium;102, a reproduction circuit; 103, a buffer memory; 104, a decoder; 104a, a decoded data output terminal; 105, a buffer occupation amountdetection circuit; 106, a buffer size detection circuit; 108, a bufferfetch start detection circuit; 109, a buffer fetch end detectioncircuit; 111, a buffer size determination circuit; 112, a controlcircuit; 201, a bit rate detection circuit; and 202, a decoding timecalculation circuit.

The same reference numerals as in FIG. 1 of the first embodiment denoteparts having the same functions in FIG. 2. Only portions different fromthe first embodiment will be described below.

When reproduction from the recording medium 101 is started to fetch astream A in the buffer memory 103, the buffer size detection circuit 106detects vbv_buffer_size (=v_size(A)) described in the sequence header ofan elementary stream in the stream A and supplies the size to thedecoding time calculation circuit 202. The bit rate detection circuit201 detects a bit rate Ra on the basis of bit rate information of thestream A described in the sequence header in the stream A and suppliesthe bit rate Ra to the decoding time calculation circuit 202. The bufferfetch start detection circuit 108 detects a fetch start time t_(a)of thestream A in the buffer memory 103 and supplies the time to the decodingtime calculation circuit 202.

The decoding time calculation circuit 202 calculates a decoding starttime t₀ of the first frame of the stream A byt ₀ =t _(a) +v_size(A)/Ra   (14)and supplies the decoding time to t₀ the control circuit 112.

The value v_size(A)/Ra indicates a time required from the start ofstorage of data at the bit rate Ra in the buffer memory 103 untilstorage of data in V_size(A).

Decoding time t_(q) from the time t₀ is calculated by the decoding timecalculation circuit 202 byt _(q) =t ₀ +T _(v) ×q(q=0, 1, 2, . . . )   (2)and supplied to the control circuit 112.

The buffer fetch end detection circuit 109 detects a data fetch end timet_(e) of the stream A in the buffer memory 103 and supplies the timet_(e) to the decoding time calculation circuit 202 and control circuit112.

The buffer size detection circuit 106 detects vbv_buffer_size(=v_size(B)) of a stream B and supplies it to the decoding timecalculation circuit 202. The bit rate detection circuit 201 detects abit rate Rb and supplies it to the decoding time calculation circuit202.

The decoding time calculation circuit 202 calculatest _(y) =t _(e) +v_size(B)/Rb   (15)and supplies the time t_(y) to the control circuit 112.

Calculation of a decoding start time t_(k) and decoding time t_(u) ofthe stream B and the method of fetching/reading the stream B in/from thebuffer memory are the same as in the first embodiment.

As described above, a size at least twice the maximum buffer sizevbv_buffer_size processible by the reproduction apparatus is prepared inthe buffer memory, as in the first embodiment. The time t_(e) at whichthe last data of the reproduced data of the preceding stream A is readout from the recording medium is detected. From the read end time t_(e),fetch of the reproduced data of the next stream B in the buffer memoryis started. That is, even when the fetch amount in the buffer memoryexceeds vbv_buffer_size, the data of the stream B can be fetched in thebuffer memory. The reproduction time of the stream B is recalculated onthe basis of the read end time t_(e), the bit rate of the stream B, andvbv_buffer_size. Hence, discontinuity of decoding times can be minimizedat the reproduction transition from the stream A to the stream B.Discontinuity of a moving image can also be minimized (in thisembodiment, when t_(y)≦t_(n+1), the continuity of decoding times ismaintained, as shown in FIG. 4, and a moving image is smoothlyreproduced).

Third Embodiment

FIG. 3 is a block diagram showing the arrangement of an imagereproduction apparatus according to the third embodiment of the presentinvention.

Referring to FIG. 3, reference numeral 101 denotes a recording medium;102, a reproduction circuit; 103, a buffer memory; 104, a decoder; 104a, a decoded data output terminal; 105, a buffer occupation amountdetection circuit; 106, a buffer size detection circuit; 107, avbv_delay detection circuit; 108, a buffer fetch start detectioncircuit; 109, a buffer fetch end detection circuit; 110, a decoding timecalculation circuit; 301, a buffer size determination circuit; and 302,a control circuit.

The same reference numerals as in FIG. 1 of the first embodiment denoteparts having the same functions in FIG. 3. Only portions different fromthe first embodiment will be described below.

When reproduction of a stream A recorded on the recording medium 101starts, the buffer size detection circuit 106 detects vbv_buffer_size(=v_size(A)) of the stream A and supplies it to the buffer sizedetermination circuit 301. The buffer size determination circuit 301calculates the value vbv_buffer_size=v_size(A) of the stream A byVsize=v_size(A)   (16)and supplies the value Vsize to the control circuit 302.

The control circuit 302 sets the value Vsize (=v_size(A)) as the size ofthe buffer memory 103.

Derivation of a reproduction start time t₀ and decoding time t_(q) ofthe stream A and buffer fetch/read control are the same as in the firstor second embodiment.

When fetch of a stream B in the buffer memory 103 starts at a fetch endtime t_(e) of the stream A in the buffer memory 103, the buffer sizedetection circuit 106 detects vbv_buffer_size (=v_size(B)) of the streamB and supplies it to the buffer size determination circuit 301.

The buffer size determination circuit 301 calculates the sum of thevalue vbv_buffer_size=v_size(A) of the stream A and the valuevbv_buffer_size=v_size(B) of the stream B byVsize=v_size(A)+v_size(B)   (17)and supplies the value Vsize to the control circuit 302.

The control circuit 302 sets the value Vsize (=v_size(A)+v_size(B))again as the size of the buffer memory 103.

Read control of the stream A, buffer fetch/read control of the stream B,and calculation of a decoding start time t_(k) and decoding time t_(u)are the same as in the first or second embodiment.

At a read end time t_(n) of last data V_(n) of the stream A from thebuffer memory 103, the control circuit 302 notifies the buffer sizedetermination circuit 301 that sweep of the stream A from the buffermemory 103 is ended.

Upon recognizing that sweep of the stream A from the buffer memory 103is ended, on the basis of vbv_buffer_size=v_size(B) of the stream B, thebuffer size determination circuit 301 sets Vsize asVsize=v_size(B)   (18)and supplies the value to the control circuit 302.

The control circuit 302 sets Vsize=v_size(B) supplied from the buffersize determination circuit 301 again as the size of the buffer memory103.

Buffer fetch/read control of the stream B from the time t_(n) andcalculation of the decoding start time t_(k) and decoding time t_(u) arethe same as in the first or second embodiment.

As described above, in seamless reproduction, vbv_buffer_size=v_size(A)of the preceding stream A is detected. While only the reproduced data ofthe stream A is present in the buffer memory, the buffer size is set tovbv_buffer_size=v_size(A) of the stream A. The time t_(e) at which thelast data of the stream A is read out from the recording medium isdetected. From the fetch end time t_(e), fetch of the next stream B inthe buffer memory is started. Then, vbv_buffer_size=v_size(B) of thestream B is detected. While both the stream A and the stream B arepresent in the buffer memory, the buffer size is set again tov_size(A)+v_size(B). With this arrangement, even when the fetch amountof the stream B in the buffer memory exceeds vbv_buffer_size, the datacan be fetched in the buffer memory. The reproduction time of the streamB is recalculated on the basis of the read end time t_(e) of the streamA. Hence, discontinuity of decoding times can be minimized at thereproduction transition from the stream A to the stream B. Discontinuityof a moving image can also be minimized (in this embodiment, whent_(y)≦t_(n+1), the continuity of decoding times is maintained, as shownin FIG. 4, and a moving image is smoothly reproduced).

As described above, according to the above-described embodiments, incontinuous reproduction of a moving image, discontinuity of the movingimage can be suppressed as much as possible.

Other Embodiment

The object of the embodiments can also be achieved by supplying astorage medium (or recording medium) which records software programcodes for implementing the functions of the above-described embodimentsto a system or apparatus and causing the computer (or CPU or MPU) of thesystem or apparatus to read out and execute the program codes stored inthe storage medium. In this case, the program codes read out from thestorage medium implement the functions of the above-describedembodiments by themselves, and the storage medium which stores theprogram codes constitutes the present invention. The functions of theabove-described embodiments are implemented not only when the readoutprogram codes are executed by the computer but also when the operatingsystem (OS) running on the computer performs part or all of actualprocessing on the basis of the instructions of the program codes.

The functions of the above-described embodiments are also implementedwhen the program codes read out from the storage medium are written inthe memory of a function expansion card inserted into the computer or afunction expansion unit connected to the computer, and the CPU of thefunction expansion card or function expansion unit performs part or allof actual processing on the basis of the instructions of the programcodes.

When the present invention is applied to the storage medium, programcodes corresponding to the above-described procedures are stored in thestorage medium.

The present invention is not limited to the above embodiments andvarious changes and modifications can be made within the spirit andscope of the present invention. Therefore, to apprise the public of thescope of the present invention, the following claims are made.

CLAIM OF PRIORITY

This application claims priority from Japanese Patent Application No.2004-244126 filed on Aug. 24, 2004, which is hereby incorporated byreference herein.

1. An image reproduction apparatus, comprising: a reproducing device which continuously reproduces a plurality of image data streams each encoded by using inter-frame encoding; a buffer memory which temporarily stores the encoded image data stream reproduced by said reproducing device; a decoding time calculation device which calculates a decoding time as a timing at which the encoded image data stream is output from the buffer memory to a decoder; a buffer size setting device which sets an amount of the buffer memory for storing the encoded image data stream on the basis of an amount required by the encoded image data stream reproduced by the reproducing device, the buffer size setting device setting the amount of the buffer memory to at least twice a maximum value of the amount required by the encoded image data stream reproduced by the reproducing device; a control device which controls the buffer memory, so as to succeedingly start storing a second encoded image data stream in the buffer memory after storage of a first encoded image data stream in the buffer memory is ended, and to continuously output the first encoded image data stream and the second encoded image data stream stored in the buffer memory to the decoder according to the decoding time calculated by the decoding time calculation device, the first encoded image data stream and the second encoded image data stream being included in the plurality of image data streams reproduced by said reproducing device, the decoding time calculation device calculating a first decoding time of the second encoded image data stream on the basis of a time when storage of the first encoded image data stream in said buffer memory is ended and a first vbv_Delay value of the second encoded image data stream.
 2. The apparatus according to claim 1, wherein the encoded image data stream is an MPEG data stream.
 3. The apparatus according to claim 1, wherein said decoding time calculation device calculates the decoding time on the basis of storage amount information contained in the encoded image data stream and a bit rate of the encoded image data stream.
 4. The apparatus according to claim 3, wherein the storage amount information contained in the encoded image data stream is vbv_buffer_size.
 5. An image reproduction apparatus, comprising: a reproducing device which continuously reproduces a plurality of image data streams each encoded by using inter-frame encoding; a buffer memory which temporarily stores the encoded image data stream reproduced by the reproduction device; a decoding time calculation device which calculates a decoding time as a timing at which the encoded image data stream is output from the buffer memory to a decoder; a buffer size setting device which sets an amount of the buffer memory for storing the encoded image data stream on the basis of an amount required by the encoded image data stream reproduced by the reproducing device; a control device which controls said buffer memory so as to succeedingly start storing a second encoded image data stream in the buffer memory after storage of a first encoded image data stream in the buffer memory is ended and, and to continuously output the first encoded image data stream and the second encoded image data stream stored in the buffer memory to the decoder according to the decoding time calculated by the decoding time calculation device, the first encoded image data stream and the second encoded image data stream being included in the plurality of image data streams reproduced by said reproducing device, wherein said control device controls such that the buffer size setting device sets the amount of the buffer memory based on an amount required by the first encoded image data stream and the first encoded image data stream is stored in the buffer memory, and resets the amount of the buffer memory based on a sum of a value of the amount required by the first encoded image stream and a value of an amount required by the second encoded image data stream after storage of the first encoded image data stream in said buffer memory is ended, and the first encoded image data stream and the second encoded image data stream are succeedingly stored in the buffer memory, and the decoding time calculation device calculates a first decoding time of the second encoded image data stream on the basis of a time when storage of the first encoded image data stream in said buffer memory device is ended and a first vbv_Delay value of the second encoded image data stream.
 6. The apparatus according to claim 5, wherein the encoded image data stream is an MPEG data stream.
 7. The apparatus according to claim 5, wherein said decoding time calculation device calculates the decoding time on the basis of storage amount information contained in the encoded image data stream and a bit rate of the encoded image data stream.
 8. The apparatus according to claim 7, wherein the storage amount information contained in the encoded image data stream is vbv_buffer_size.
 9. A method of controlling an image reproduction apparatus including a reproducing device which continuously reproduces a plurality of image data streams each encoded by using inter-frame encoding, a buffer memory which temporarily stores encoded image data stream reproduced by said reproducing device, a buffer size setting device which sets an amount of the buffer memory for storing the encoded image data stream, and a decoding time calculation device which calculates a decoding time at which the encoded image data stream is output from the buffer memory to a decoder, said method comprising: a buffer size setting step of causing the buffer size setting device to set the amount of the buffer memory to at least twice an amount required by an encoded image data stream reproducible by the reproducing device; a control step of controlling the buffer memory so as to succeedingly start storing a second encoded image data stream in the buffer memory after storage of a first encoded image data stream in the buffer memory is ended, and to continuously output the first encoded image data stream and the second encoded image data stream stored in the buffer memory to the decoder according to the decoding time calculated by decoding time calculation device, the first encoded image data stream and the second encoded image data stream being included in the plurality of image data streams reproduced by the reproducing device; and a decoding time calculation step of causing the decoding time calculation device to calculate a first decoding time of the second encoded image data stream on the basis of a time when storage of the first encoded image data stream in the buffer memory is ended and a first vbv_Delay value of the second encoded image data stream.
 10. The method according to claim 9, wherein the encoded image data stream is an MPEG data stream.
 11. The method according to claim 9, wherein in the decoding time calculation step, the decoding time is calculated on the basis of storage amount information contained in the encoded image data stream and a bit rate of the encoded image data stream.
 12. The method according to claim 11, wherein the storage amount information contained in the encoded image data stream is vbv_buffer_size.
 13. A method of controlling an image reproduction apparatus including a reproducing device which continuosly reproduces a plurality of image data streams each encoded by using inter-frame encoding, a buffer memory which temporarily stores an encoded image data stream reproduced by said reproduction device, a buffer size setting device which sets an amount of the buffer memory for storing the encoded image data stream, and a decoding time calculation device which calculates a decoding time at which the encoded image data stream is output from the buffer memory to a decoder, said method comprising: a buffer size setting step of causing the buffer size setting device to set an amount of the buffer memory for storing the encoded image data stream on the basis of an amount required by the encoded image data stream reproduced by the reproducing device; a control step of controlling the buffer memory so as to succeedingly start storing a second encoded image data stream in the buffer memory after storage of a first encoded image data stream in the buffer memory is ended, and to continuously output the first encoded image data stream and the second encoded image data stream stored in the buffer memory to the decoder according to the decoding time calculated by the decoding time calculation device, the first encoded image data stream and the second encoded image data stream being included in the plurality of image data streams reproduced by the reproducing device; a buffer size re-setting step of resetting the amount of the buffer memory based on a sum of a value of the amount required by the first encoded image data stream and a value of an amount required by the second encoded image data stream after storage of the first encoded image data stream in the buffer memory is ended and the first encoded image data stream and the second encoded image data stream are succeedingly stored in the buffer memory; and a decoding time calculation step of causing the decoding time calculation device to calculate a first decoding time of the second encoded image data stream on the basis of a time when storage of the first encoded image data stream in the buffer memory is ended and a first vbv_Delay value of the second encoded image data stream.
 14. The method according to claim 13, wherein the encoded image data stream is an MPEG data stream.
 15. The method according to claim 13, wherein in the decoding time calculation step, the decoding time is calculated on the basis of storage amount information contained in the encoded image data stream and a bit rate of the encoded image data stream.
 16. The method according to claim 15, wherein the storage amount information contained in the encoded image data stream is vbv_buffer_size. 